<template>
	<view>
		<view class="vio-list">
			<navigator class="vio-item" v-for="item in list2" url="/pages/vio-detail/vio-detail">
				<view class="top">
					<text>违章</text>
					<view class="status center">{{item.disposeState}}</view>
				</view>
				<view class="bottom">
					<text>违章计分：{{item.deductMarks}}分</text>
					<text>罚款金额：{{item.money}}元</text>
					<text>违章地点：{{item.illegalSites}}</text>
				</view>
				<view class="date">{{item.badTime}}</view>
			</navigator>
			<button class="bu" style="margin-top: 40rpx;" v-if="flag === true" @click="submit">查看更多</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				flag: true,
				list: [
					{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},
					{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},
				],
				list2: [
					{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},
					{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					},{
						disposeState: '已缴款',
						deductMarks: '6',
						money: '200',
						illegalSites: '派出所',
						badTime: '2023-9-30 11:52:11'
					}
				]
			};
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList(){
				this.$request({
					url: '/prod-api/api/traffic/illegal/list'
				}).then(res => {
					console.log(res)
				})
			},
			submit(){
				this.list2 = this.list
				this.flag = false
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #f7f7f7;
	view{
		padding: 20rpx;
		.vio-list{
			display: flex;
			flex-direction: column;
			padding: 20rpx;
			.vio-item{
				background-color: #fff;
				padding: 20rpx;
				display: flex;
				flex-direction: column;
				margin-top: 40rpx;
				border-radius: 20rpx;
				&:first-child{
					margin-top: 0;
				}
				.top{
					display: flex;
					flex-direction: row;
					justify-content: space-between;
					align-items: center;
					text{
						font-size: 36rpx;
						font-weight: bold;
					}
					.status{
						background-color: #909399;
						width: 120rpx;
						height: 60rpx;
						font-size: 26rpx;
						border-radius: 10rpx;
						color: white;
					}
				}
				.bottom{
					display: flex;
					flex-direction: column;
					text{
						font-size: 26rpx;
						margin-top: 10rpx;
					}
				}
				.date{
					display: flex;
					flex-direction: row;
					justify-content: right;
					color: #666;
					font-size: 26rpx;
				}
			}
		}
	}
}
</style>
